#include "AccusationView.h"

#include <boost/bind.hpp>
#include "../../models/network/CardSetViewModel.h"
#include "../../../utils/LateEvents.hpp"
#include "../../../domain/configuration/NetworkConfiguration.h"

using namespace Views::Client;
using namespace Utils;

AccusationView::AccusationView(Domain::Network::GameClient* client, Utils::GUI::Form* form)
	: Graphic::AccusationView(form), client(client)
{
}

void AccusationView::onDecisionSet(bool decision)
{
	sf::Packet packet;
	packet << decision;
	client->send(Domain::Configuration::Network::ACCUSATION_DECISION, packet);
	Graphic::AccusationView::onDecisionSet(decision);
}

void AccusationView::onCardsSet(Cards::CardSet cards)
{
	sf::Packet packet;
	Views::Models::Network::CardSetViewModel csvm(cards);
	packet << csvm;
	client->send(Domain::Configuration::Network::ACCUSATION_CARDS, packet);
	Graphic::AccusationView::onCardsSet(cards);
}

